//
//  SearchViewCustom.m
//  EJLX
//
//  Created by adc on 15/11/10.
//  Copyright © 2015年 江苏一键联信息科技有限公司. All rights reserved.
//

#import "SearchViewCustom.h"

@implementation SearchViewCustom

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

+(UIView *)creatTheSearchViewWithFrame:(CGRect)frame Taget:(id)taget action:(SEL)action actionTextField:(SEL)actionTF{
    UIView *vc = [[UIView alloc] initWithFrame:frame];
    
    
    
    UILabel *searchLB = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, 22)];
    searchLB.layer.borderWidth = 1;
    searchLB.text = @"  商品>";
    searchLB.layer.borderColor = [UIColor redColor].CGColor;
    searchLB.backgroundColor = [UIColor whiteColor];
    [vc addSubview:searchLB];
    
    UITextField *searchTF = [[UITextField alloc] initWithFrame:CGRectMake(65, 1, frame.size.width-120, 20)];
    searchTF.backgroundColor = [UIColor whiteColor];
    searchTF.placeholder = @"请输入商品名称";
    searchTF.borderStyle = UITextBorderStyleRoundedRect;
    [searchTF addTarget:self action:actionTF forControlEvents:UIControlEventAllTouchEvents];
    [vc addSubview:searchTF];
    
    UIButton *searchbtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [searchbtn setTitle:@"搜索" forState:UIControlStateNormal];
    searchbtn.frame = CGRectMake(frame.size.width-60, 1, 60, 20);
    searchbtn.backgroundColor = [UIColor yellowColor];
    [searchbtn addTarget:self action:action forControlEvents:UIControlEventAllTouchEvents];
    [vc addSubview:searchbtn];
    return vc;
}

@end
